import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './updatepatient.css'
import { AtCheckbox,AtButton,AtIcon} from 'taro-ui'
import { $redirectTo } from '../../../global';
import reactMixin from 'react-mixin';
import myJs from '../../pages/updatepatient/updatepatientjs.js'
import app from '../../../main.js'

export default class UpdatePatient extends Component {

  config = {
    navigationBarTitleText: '修改标签患者'
  }
  constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
  constructor () {
    super(...arguments)
    this.state = {
      checkedList: ['list1']
    }
    this.checkboxOption = [{
        value: 'list1',
        label: '刘文西',
        desc: '青光眼，肾结石'
      },{
        value: 'list2',
        label: '阮心仪',
        desc: '阑尾炎'
      },{
        value: 'list3',
        label: '于雪',
        desc: '白内障，十二指肠溃疡出血'
      },{
        value: 'list4',
        label: '万宗程',
        desc: '大隐静脉曲张'
    }]
  }

  handleChange (value) {
    this.setState({
      checkedList: value
    })
  }

  saveLabel=()=>{
    app.redirectTo('../editlabel/editlabel');
  }
  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    return (
      <View id='update-patient'>
        <AtCheckbox
        options={this.checkboxOption}
        selectedList={this.state.checkedList}
        onChange={this.handleChange.bind(this)}
      />
        <View className='btn'>
                <AtButton type='primary' size='normal' className='btn-son' onClick={this.saveLabel}><AtIcon value='check-circle' size='30' color='white' className="btn-icon"></AtIcon>确定选择患者
                </AtButton>
                </View>
      </View>
    )
  }
}
reactMixin.onClass(UpdatePatient,myJs);
